using ArcGIS.Desktop.Framework.Threading.Tasks;
using System.Diagnostics;

namespace ArcGISProMSTest
{
    [ArcGISTestClass]
    public class UnitTest1
    {
        static string message = string.Empty;
        [ClassInitialize]
        public static void ClassInitialize(TestContext testContext)
        {
            //Prepare
            message = "Hello ArcGIS Pro MSTest";
        }

        [TestMethod]
        public void Test1()
        {
            Debug.WriteLine(message);
        }

        [DataTestMethod]
        [DataRow("Hello", DisplayName = "Test Write Hello")]
        [DataRow("ArcGIS", DisplayName = "Test Write ArcGIS")]
        [DataRow("Pro", DisplayName = "Test Write Pro")]
        [DataRow("MSTest", DisplayName = "Test Write MSTest")]
        public void Test2(string message)
        {
            Debug.WriteLine(message);
            Thread.Sleep(1000);
        }

        [DataTestMethod]
        [DataRow("Hello", DisplayName = "Test Write Hello")]
        [DataRow("ArcGIS", DisplayName = "Test Write ArcGIS")]
        [DataRow("Pro", DisplayName = "Test Write Pro")]
        [DataRow("MSTest", DisplayName = "Test Write MSTest")]
        public async Task Test3(string message)
        {
            await QueuedTask.Run(() =>
             {
                 Debug.WriteLine(message);
                 Thread.Sleep(1000);
             });
        }
    }
}